import { defineStore } from 'pinia'
import { Local } from '../utils/storage'

// 布局设置
export const layoutConf = defineStore('layoutConf', {
  state: () => ({
    isCollapse: false, // 菜单是否收缩
    darkMenu: Local.get('darkMenu'),
  }),
  actions: {
    // 设置是否收缩
    triggerIsCollapse() {
      this.isCollapse = !this.isCollapse
    },
    // 设置是否启动黑色菜单
    triggerDarkMenu() {
      this.darkMenu = !this.darkMenu
    },
  },
})
